# 将单个数据转为dict
def model_to_dict(object):
    return {c.name: getattr(object, c.name) for c in object.__table__.columns}


# 将一组数据转为list
def scalars_to_list(object):
    return [model_to_dict(c) for c in object]
